package org.mydzms.com.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.dzms.entity.Userinfos;
import org.mydzms.services.personl.PersoalServices;

/**
 * Servlet implementation class PersonalPicServlet
 */
public class PersonalPicServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private PersoalServices personalServices = new PersoalServices();

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		String pic =request.getParameter("image_file");
		System.out.println(pic);
		Userinfos us = new Userinfos();
		us.setUserpic(pic);
		
		personalServices.updatePic(us);

	}

}
